import {
	getMenu
} from '../store/user.js'
export const has=function(btnCode){
	let hasBtn=false;
	const list = getMenu("user_uri");
	const roles = list.map((item) => {
		return item.code;
	})
	console.log(roles,'rolesrolesroles');
	if (btnCode) {
		const hasPermission = roles.some(role => {
			return btnCode === role
		})
		if (!hasPermission) {
			hasBtn= false
		}else hasBtn= true
	}
	return hasBtn;
};